/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.repair.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiOperation;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.repair.entity.MaintainCheckSpecialRecord;
import org.springblade.modules.repair.service.MaintainCheckSpecialRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * @Date 8:50 2021/11/2
 * @Description {
 *   专项检查项操作记录
 * }
 * @Author lsay
 **/
@RestController
@RequestMapping("repair/special/history/record")
public class SpecialHistoryRecordController extends BladeController {

	@Autowired
	private MaintainCheckSpecialRecordService specialRecordService;

	/**
	 * 新增专项检查项操作记录
	 */
	@PostMapping("/save")
	@ApiOperationSupport(order = 4)
	@ApiOperation(value = "新增", notes = "传入maintainCheckHistory")
	public R save(@Valid @RequestBody MaintainCheckSpecialRecord specialRecord) {
		return R.status(specialRecordService.saveOrUpdate(specialRecord));
	}

	/**
	 * 删除专项检查项操作记录
	 * @param ids
	 * @return
	 */
	@DeleteMapping("/delete")
	public R<Boolean> deleteSpecialRecord(@RequestParam String ids){
		return R.data(specialRecordService.removeByIds(Func.toLongList(ids)));

	}




}




























